﻿using System;
//作业1
public void Test1()
{
    Console.WriteLine("请输入一个年份:\n");
    int year=Convert.ToInt32(Console.ReadLine());
    if ((year % 4 == 0 && year % 100 != 0)||(year % 400 == 0))
    {
        Console.WriteLine("该年份是闰年");
    }
    else
    {
        Console.WriteLine("该年份不是闰年");
    }
}
    
//作业2
public void Test2()
{
    Console.WriteLine("请选择出行方式：\n1.航班出行\n2.动车出行\n");
    int x=Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("请输入月份\n");
    int month=Convert.ToInt32(Console.ReadLine());
    double price = 8800;
    if (month >= 5 && month <= 10)
    {
        if (x == 1)
        {
            price = price * 0.9;
        }
        else if (x == 2)
        {
            price = price * 0.75;
        }
    }
    else
    {
        if (x == 1)
        {
            price = price * 0.6;
        }
        else if (x == 2)
        {
            price = price * 0.3;
        }
    }
    Console.WriteLine("本次旅游所需要的价格为{price}");
}